package ru.housewife.form;

import ru.housewife.model.Measure;

import java.util.HashMap;
import java.util.Map;

/**
 * Form object for
 * @see ru.housewife.model.Ware
 *
 * @author Alexander Troshanin
 */
public class WareForm implements Comparable<WareForm> {

    private long id;

    private String name;

    private Measure measure;

    private float count;

    private WaresGroupForm groupForm;

    private IngredientForm ingredient;

    private boolean ingredientsDefault;
//    private Map<Long, Double> pricesByRegion;

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Measure getMeasure() {
        return measure;
    }

    public void setMeasure(Measure measure) {
        this.measure = measure;
    }

    public float getCount() {
        return count;
    }

    public void setCount(float count) {
        this.count = count;
    }

    public WaresGroupForm getGroupForm() {
        return groupForm;
    }

    public void setGroupForm(WaresGroupForm groupForm) {
        this.groupForm = groupForm;
    }

    public IngredientForm getIngredient() {
        return ingredient;
    }

    public void setIngredient(IngredientForm ingredient) {
        this.ingredient = ingredient;
    }

    public boolean isIngredientsDefault() {
        return ingredientsDefault;
    }

    public void setIngredientsDefault(boolean ingredientsDefault) {
        this.ingredientsDefault = ingredientsDefault;
    }

    @Override
    public int compareTo(WareForm that) {
        if (this.name == null) {
            return -1;
        }
        if (that.name == null) {
            return 1;
        }
        return this.name.compareTo(that.name);
    }

}
